package be.kdg.bombermanunlimited.server;

import java.rmi.registry.LocateRegistry;
import be.kdg.bombermanunlimited.server.remote.finalclasses.Game;
import be.kdg.bombermanunlimited.server.remote.interfaces.IGame;

public class GameTest {

	public static void main(String[] args) {
		try {
			System.setProperty("java.rmi.server.hostname", "127.0.0.1");
			LocateRegistry.createRegistry(2020);
			IGame game = new Game();
			LocateRegistry.getRegistry(2020).rebind("/Game", game);
			System.out.println("server opgezet!");
			while (game.getPlayerCount() != 4) {
				Thread.sleep(1000);
				//game.updateClients();
			}
			Thread.sleep(1000);
			game.start();
			while (true) {
			}

		} catch (Exception e) {
			System.err.println("Game excepion:" + e);
			e.printStackTrace();
		}
	}
}
